import Router from 'koa-router'

import DlyRoleController from '../controller/dlyadmin/roleController'

const router = new Router()

router.prefix('/dlyadminapi/role')

router
	/**
	 * @swagger
	 * /dlyadminapi/role/add:
	 *   post:
	 *     description: 添加角色
	 *     tags: [后台用户]
	 *     summary: "添加角色"
	 *     parameters:
	 *       - name: role
	 *         in: body
	 *         description: 名称
	 *         required: true
	 *       - name: role_name
	 *         in: body
	 *         description: 标识
	 *         required: true
	 *     produces:
	 *       - application/json
	 *     responses:
	 *       200:
	 *         description: 获取数据列表
	 * */
	.post('/add', DlyRoleController.add)
	/**
	 * @swagger
	 * /dlyadminapi/role/list:
	 *   get:
	 *     description: 角色列表
	 *     tags: [后台用户]
	 *     summary: "角色列表"
	 *     parameters:
	 *     produces:
	 *       - application/json
	 *     responses:
	 *       200:
	 *         description: 获取数据列表
	 * */
	.get('/list', DlyRoleController.list)
	/**
	 * @swagger
	 * /dlyadminapi/role/deleted:
	 *   get:
	 *     description: 删除角色
	 *     tags: [后台用户]
	 *     summary: "删除角色"
	 *     parameters:
	 *     produces:
	 *       - application/json
	 *     responses:
	 *       200:
	 *         description: 获取数据列表
	 * */
	.delete('/deleted', DlyRoleController.deleted)

    /**
	 * @swagger
	 * /dlyadminapi/role/update:
	 *   get:
	 *     description: 编辑角色
	 *     tags: [后台用户]
	 *     summary: "编辑角色"
	 *     parameters:
	 *     produces:
	 *       - application/json
	 *     responses:
	 *       200:
	 *         description: 获取数据列表
	 * */
	.put('/update', DlyRoleController.update)

export default router
